home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
lzw4c.exe
/
LZW4C.DOC
< prev
next >
Wrap
Text File
|
1992-02-28
|
38KB
|
1,007 lines
LZW Data Compression Library
For the C Language
(LZW4C)
USERS MANUAL
Version 1.2
March 1, 1993
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 1993
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815
205-881-4630 Voice / FAX
205-880-9748 Support BBS
LZW4C Users Manual Page 1
C O N T E N T S
Chapter Page
1.0 Introduction..............................................3
1.1 Distribution Files....................................3
1.2 Compiling the Library.................................4
1.3 User Support..........................................4
1.4 Installation..........................................5
2.0 The LZW Algorithm.........................................6
2.1 LZW Compression.......................................6
2.2 LZW Expansion.........................................7
2.3 LZW Implementation....................................7
3.0 Example Programs..........................................8
3.1 COMPRESS..............................................8
3.2 EXPAND................................................8
3.3 TEST_LZW..............................................9
3.4 MK_ARC................................................9
3.5 UN_ARC................................................9
3.6 SEE_ARC...............................................9
4.0 Reader & Writer Functions................................10
5.0 Library Functions........................................11
5.1 InitLZW..............................................11
5.2 TermLZW..............................................11
5.3 Compress.............................................12
5.4 Expand...............................................12
6.0 Error Codes..............................................13
6.1 EXPANSION_ERROR......................................13
6.2 CANNOT_ALLOCATE......................................13
6.3 INTERNAL_ERROR.......................................13
6.4 NOT_READY............................................13
7.0 Legal Issues.............................................14
7.1 Registration.........................................14
7.2 License..............................................15
7.3 Warranty.............................................15
8.0 Revision History.........................................15
9.0 Other MarshallSoft Computing Products for C..............16
9.1 The Personal Communications Library for C............16
9.2 The Personal Protocol Library for C..................16
LZW4C Users Manual Page 2
1.0 Introduction
LZW4C consists of a variable code size implementation of the LZW
(Lempel-Ziv-Welch) algorithm for compressing and decompressing
data. LZW does particularly well on text files, achieving better
than a 50 % compression ratio for many files.
The LZW algorithm is considered to be one of the best general
purpose algorithms available today. The new high speed modems
that employ on-the-fly data compression (such as MNP 5.0 & the
V.42 bis international standard) use the LZW algorithm, as well
as such well known utility programs such as PKZIP.
The LZW4C library is designed to be used in a wide variety of
situations. Some of the possible uses include:
1) Compression and expanding files on disk.
2) Compressing files "on the fly" before sending over a modem,
and then expanding on the receiving end.
3) Compression of data files used by your application program such
as help files, graphics screens, etc. The compressed data files
are then expanded as they are loaded by the application.
1.1 Distribution Files
The distribution files are as follows:
1) LZW4C_C.LIB -- COMPACT model library.
2) LZW4C_L.LIB -- LARGE model library.
3) LZW4C_L.MIX -- LARGE model library (MIX only).
4) LZW4C.DOC -- This documentation file.
5) LZW4C.INV -- Invoice file.
6) COMPRESS.C -- Data compression example program.
7) EXPAND.C -- Data expansion example program.
8) LZW4C.H -- Library prototypes.
9) TEST_LZW.C -- LZW test driver program.
10) MK_ARC.C -- File archiving program.
11) UN_ARC.C -- File un-archiving program.
12) SEE_ARC.C -- Program to list archived files.
13) *._T_ -- Turbo C makefiles.
14) *._M_ -- Microsoft C makefiles.
15) X_*.BAT -- MIX Power C batch file.
16) RW_IO.C -- Reader/Writer I/O source file.
17) RW_IO.H -- Reader/Writer prototype file.
18) DIR_IO.C -- Directory I/O source file.
19) DIR_IO.H -- Directory I/O prototype file.
20) SAYERROR.C -- Displays text error messages.
Registered users also receive:
1) LZW4C.ASM -- SOURCE CODE for the LZW4C libraries.
2) MAKE_C.BAT -- Batch file to make LZW4C_C.LIB
3) MAKE_L.BAT -- Batch file to make LZW4C_L.LIB
4) MAKE_XL.BAT -- Batch file to make LZW4C_L.MIX
LZW4C Users Manual Page 3
1.2 Compiling the Library
LZW4C requires rather large work buffers at run time. This
requires "far" data pointers which in turn means that you must
compile using either the COMPACT memory model (with "near" code
pointers) or the LARGE memory model (with "far" code addresses).
There are, therefore, two memory model libraries provided:
lzw4c_c.lib -- Compact memory model library.
lzw4c_l.lib -- Large memory model library.
lzw4c_l.mix -- Large memory model library (MIX only).
The registered user can re-compile the source code (source code is
provided in the registered version only) for the library using one
of the two provided batch files:
make_c.bat -- Creates lzw4c_c.lib.
make_l.bat -- Creates lzw4c_l.lib.
make_xl.bat -- Create lzw4c_c.mix.
Using the COMPACT memory model will result in a slightly smaller
and faster executable than using the LARGE memory model. Be sure
to compile all of your code for the correct memory model. Refer to
your compiler manual for more information on memory models.
1.3 User Support
We want you to be successful in developing your application using
our libraries! We depend on our customers to let us know what they
need in a library. This means we are committed to providing the
best libraries that we can. If you have any suggestions or
comments, please write to us or